#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

const int N = 1e6 + 10;
int n, a[N];
int main()
{
	cin >> n;
	a[0] = 1;
	int d = 1;
	for (int i = 1; i <= n; i++)
	{
		int x = 0;
		int ans = 0;
		for (int j = 0; j < d; j++)
		{
			ans = a[j] * i + x;
			a[j] = ans % 10;
			x = ans / 10;
		}
		while (x)
		{
			a[d++] = x % 10;
			x /= 10;
		}
	}
	for (int i = d - 1; i >= 0; i--)
	{
		cout << a[i];
	}
	cout << endl;
	return 0;
}